home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
varia
/
idioms.lha
/
idioms
/
5-2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-04
|
1KB
|
51 lines
/* Copyright (c) 1992 by AT&T Bell Laboratories. */
/* Advanced C++ Programming Styles and Idioms */
/* James O. Coplien */
/* All rights reserved. */
class Telephone {
public:
void ring();
Bool isOnHook() isTalking(), isDialing();
DigitString collectDigits();
LineNumber extension();
~Telephone();
protected:
Telephone();
LineNumber extensionData;
};
class POTSPhone : public Telephone {
public:
Bool runDiagnostics();
POTSPhone();
POTSPhone(POTSPhone&);
~POTSPhone();
private:
Frame frameNumberVal;
Rack rackNumberVal;
Pair pairVal;
};
class ISDNPhone : public Telephone {
public:
ISDNPhone();
ISDNPhone(ISDNPhone&);
~ISDNPhone();
void sendBPacket(), sendDPacket();
private:
Channel b1, b2, d;
};
class OperatorPhone : public ISDNPhone {
public:
OperatorPhone();
OperatorPhone(OperatorPhone&);
~OperatorPhone();
void ring(); // special ringing needed for operator
};
class PrincessPhone : public POTSPhone {
. . . .
};